<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script>
    $(document).ready(function($) {

        if($("#reward_id option:selected").val() != 'Material')
        {
            /*$('.reward_id').attr('disabled', false);
            $('.reward_type').attr('disabled', true);
            $('.count').attr('disabled', true);*/
        }

        $("#reward_data").change(function()
        {
            /*if($(this).val() == 'Material')
            {
                $('.reward_id').attr('disabled', false);
                $('.reward_type').attr('disabled', true);
                $('.count').attr('disabled', true);
            }
            else
            {
                $('.reward_id').attr('disabled', false);
                $('.reward_type').attr('disabled', true);
                $('.count').attr('disabled', true);
            }*/
        });
    });
</script>
<script type="text/javascript">
    function confirmForm(){
        if ( confirm("보내시겠습니까？")){
                var your_name = testform.your_name.value;
                if( your_name == "" ){
                    alert("캐릭터 이름을 적어주세요！");
        	    testform.your_name.focus();
                    return false;
                }
                alert("안녕" + your_name + "！");
            } else {
                return false;
            }
    }
</script>


<style type="text/css">
    #total_width {
        width: 900px;
    }
    .title_center {
        width: 100px;
        text-align: center;
    }
    .button_width {
        width: 80px;
        text-align: center;
    }
</style>

<table id="total_width">
<tr>
    <?php echo $this->Form->create('multi_reward', array('onsubmit' => 'return confirm('.'"'.__('보상을 보내시겠습니까??').'");')); ?>
    <tr>
        <th colspan="8"><?php echo '다수 유저에게 아이템 보내기'?></th>
    </tr>
    <tr>
        <th class="title_center"><?php echo ('유저 캐릭터명（다수 유저인 경우, 쉼표 <,>로 구분）'); ?></th>
        <th colspan="5">
            <?php echo $this->Form->input('nick_name', array(
                'label' => false,
                'escape' => false,
                'type' => 'textarea',
                'placeholder' => '갑, 을,병 ',
                'rows' => '3'
            )); ?>
        </th>
    </tr>
    <tr>
        <th class="title_center"><?php echo ('메시지'); ?></th>
        <th colspan="5">
            <?php echo $this->Form->input('message', array(
                'label' => false,
                'escape' => false,
                'placeholder' => '운영자에게 보상입니다.'
            )); ?>
        </th>
    </tr>
    <tr>
        <th class="title_center"><?php echo ('보상종류'); ?></th>
        <th>
            <?php echo $this->Form->input('reward_type', array(
                'label' => false,
                'type' => 'select',
                'class' => 'reward_type',
                'escape' => false,
                'options' => rewardAll()
            )); ?>
        </th>
        <th class="title_center"><?php echo ('아이템'); ?></th>
        <th>
            <?php echo $this->Form->input('reward_id', array(
                'label' => false,
                'type' => 'select',
                'id' => 'reward_id',
                'escape' => false,
                'options' => $ticketId

            )); ?>
        </th>
        <th class="title_center"><?php echo ('수량'); ?></th>
        <th>
            <?php echo $this->Form->input('count', array(
                'label' => false,
                'class' => 'count',
                'escape' => false
            )); ?>
        </th>
    </tr>
    <tr>
            <th class="title_center"><?php echo ('costume종류'); ?></th>
            <th>
                <?php echo $this->Form->input('costume_id', array(
                    'label' => false,
                    'type' => 'select',
                    'id' => 'reward_id',
                    'escape' => false,
                    'options' => $costumeId

                )); ?>
            </th>
            <th class="title_center"><?php echo ('costume지속시간(hours)'); ?></th>
            <th>
                <?php echo $this->Form->input('expire_time', array(
                    'label' => false,
                    'class' => 'count',
                    'escape' => false
                )); ?>
            </th>
    </tr>
    <tr>
        <th class="button_width">
            <?php echo $this->Form->end('보내기'); ?>
        </th>
    </tr>
</tr>
    <tr>
         <?php echo $this->Form->create('sendall_item_info', array('action' => 'sendall_item')); ?>
            <tr>
                <th colspan="10"><?php echo '모두 유저에게 아이템을 보내기'?></th>
            </tr>
            <tr>
                <th class="title_center"><?php echo ('메시지'); ?></th>
                <th colspan="5">
                    <?php echo $this->Form->input('message_all', array(
                        'label' => false,
                        'escape' => false,
                        'placeholder' => '운영자에게 보상입니다.'
                    )); ?>
                </th>
            </tr>
            <tr>
                <th class="title_center"><?php echo ('보상종류'); ?></th>
                <th>
                    <?php echo $this->Form->input('reward_type_all', array(
                        'label' => false,
                        'type' => 'select',
                        'class' => 'reward_type',
                        'escape' => false,
                        'options' => rewardAll()
                    )); ?>
                </th>
                <th class="title_center"><?php echo ('아이템'); ?></th>
                <th>
                    <?php echo $this->Form->input('reward_id_all', array(
                        'label' => false,
                        'type' => 'select',
                        'id' => 'reward_id',
                        'escape' => false,
                        'options' => $ticketId

                    )); ?>
                </th>
                <th class="title_center"><?php echo ('수량'); ?></th>
                <th>
                    <?php echo $this->Form->input('count_all', array(
                        'label' => false,
                        'class' => 'count',
                        'escape' => false
                    )); ?>
                </th>
            </tr>
             <tr>
                        <th class="title_center"><?php echo ('costume종류'); ?></th>
                        <th>
                            <?php echo $this->Form->input('costume_id_all', array(
                                'label' => false,
                                'type' => 'select',
                                'id' => 'reward_id',
                                'escape' => false,
                                'options' => $costumeId

                            )); ?>
                        </th>
                        <th class="title_center"><?php echo ('costume지속시간(hours)'); ?></th>
                        <th>
                            <?php echo $this->Form->input('expire_time_all', array(
                                'label' => false,
                                'class' => 'count',
                                'escape' => false
                            )); ?>
                        </th>
                </tr>
            <tr>
                    <th class="button_width">
                        <?php echo $this->Form->end('모두 유저에게 보내기'); ?>
                    </th>
            </tr>
    </tr>
</table>

<div id="total_width">
    <?php echo $this->Session->flash('good') ?>
    <?php echo $this->Session->flash('bad') ?>
    <?php echo $this->Session->flash('bad2') ?>
</div>